import requests from "./request";
import mockRequests from "./mockAjax";

export const reqCategoryList = () => requests({ url: '/product/getBaseCategoryList', method: 'get' })
export const reqGetBannerList = () => mockRequests({ url: '/banner' })
export const reqFloorList = () => mockRequests({ url: '/floor' })
export const reqGetSearchInfo = (params) => requests({
    url: '/list',
    method: 'post',
    data: params
})
export const reqGoodInfo = (skuId) => requests({ url: `/item/${skuId}`, method: 'get' })
export const reqHandleCart = (skuId, skuNum) => requests({ url: `/cart/addToCart/${skuId}/${skuNum}`, method: 'post' })
export const reqCartList = () => requests({ url: '/cart/cartList', method: 'get' })
export const reqDeleteCartById = (skuId) => requests({ url: `/cart/deleteCart/${skuId}`, method: 'delete' })
export const reqCheckCart = (skuId, isChecked) => requests({ url: `/cart/checkCart/${skuId}/${isChecked}`, method: 'get' })
export const reqSendCode = (phone) => requests({ url: `/user/passport/sendCode/${phone}`, method: 'get' })
export const reqRegister = (data) => requests({ url: '/user/passport/register', method: 'post', data: data })
export const reqLogin = (data) => requests({ url: '/user/passport/login', method: 'post', data: data })
export const reqGetUserInfo = () => requests({ url: '/user/passport/auth/getUserInfo', method: 'get' })
export const reqLogout = () => requests({url:'/user/passport/logout', method:'get'})